package com.itany.proxy;

import com.itany.factory.ObjectFactory;

/**
 * Author:石小俊
 * Date: 2022/11/4 10:37
 */
public class Test {

    public static void main(String[] args) {
        // 通过工厂模式获取到目标对象
//        UserService userService = (UserService) ObjectFactory.getObject("userServiceTarget");
        UserService userService = (UserService) ObjectFactory.getObject("userService2");
        SomeService someService = (SomeService) ObjectFactory.getObject("someService");

        userService.login("admin","123456");
        System.out.println("**************************************");
        userService.login("admin","123321");
        System.out.println("**************************************");
        userService.register("admin");
        System.out.println("**************************************");
        someService.doSome();
        System.out.println("**************************************");
        someService.doOther();

    }

}
